using ZeroSum.Models;

namespace ZeroSum.Exceptions;

/// <summary>
///     模型验证失败的异常
/// </summary>
public class ValidateFailedException : BusinessException
{
    private ValidateFailedException(IList<string> errors) : base("数据校验失败", ResponseStatus.ValidateFailed)
    {
        Errors = errors;
    }

    public IList<string> Errors { get; }

    public static ValidateFailedException Of(IList<string> errors)
    {
        return new ValidateFailedException(errors);
    }
}